package com.digitalxpert.jargle.client;
import java.util.StringTokenizer;
public class Test {
	String text = "Stas's donWs powel gulyat";
	String word;
	private Long startIndex = 0L;
	private Long endIndex = 0L;
	private Long coord = 0L;
	private int wordLenght = 0;
	public static void main(String[] args) {
		Test t = new Test();
		t.text = "sdfsdfsdf dsf sdf sdf sdf";
		t.word = "";
		System.out.println(t.toString());
		//t.start();
	}
	private void start() {
		String text2 = text.replaceAll("'s", " ");
		System.out.println(text2);
		
		String delim = ". , < > / [ ] { } \\ | + = _ ) ( * & ^ % $ # @ ! ~ \" 1 2 3 4 5 6 7 8 9 0 : ; \n \t ?";
		StringTokenizer st = new StringTokenizer(text2, delim);
		int count = 0;
		while (st.hasMoreTokens()) {
			word = st.nextToken();
			++count;
			getCoords();
			System.out.println(word);
			System.out.println(startIndex);
			System.out.println(endIndex);
			System.out.println(count);
		}
	}
	private void getCoords() {
		String myWord = word;
		coord = (long) text.indexOf(myWord, wordLenght);
		wordLenght = myWord.length();
		startIndex += coord;
		endIndex = startIndex + wordLenght;
		text = text.substring((int) coord.longValue());
	}
}
